'''
Created on Feb 13, 2014

@author: yfrank
'''

import abc


class State(object):
    '''
    classdocs
    '''
    __metaclass__ = abc.ABCMeta

    def __init__(self,sm_):
        self.sm = sm_

    def switch_to_next_state(self,state):
        self.sm.switch_to_next_state(state)

    @abc.abstractmethod
    def process_event(self,event,data=None):
        return True

    @abc.abstractmethod
    def get_type(self):
        return 0

    def __str__(self):

        '''
        if self.get_type()==0:
            return "Null"
        if self.get_type()==1:
            return "CLOSE"
        if self.get_type()==2:
            return "OPEN"
        if self.get_type()==3:
            return "BUSY"
        '''
        return "(STATE : "+self.__class__.__name__+")"
